package com.ruoyi.web.wx.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.privacyagreement.domain.PrivacyAgreement;
import com.ruoyi.privacyagreement.service.IPrivacyAgreementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Api(tags = "隐私协议")
@RestController
@RequestMapping("/wx/agreement")
public class WxPrivacyAgreementController {

    @Autowired
    private IPrivacyAgreementService privacyAgreementService;

    /**
     * 查询所有隐私协议
     * @param privacyAgreement
     * @return
     */
    @ApiOperation("查询所有隐私协议")
    @GetMapping("/list")
    public AjaxResult list(PrivacyAgreement privacyAgreement) {
        List<PrivacyAgreement> privacyAgreements = privacyAgreementService.selectPrivacyAgreementList(privacyAgreement);
        return AjaxResult.success(privacyAgreements.get(0));
    }
}
